package com.bms.cfcmms.model.system;

import com.bms.cfcmms.model.BaseModel;
import com.bms.cfcmms.util.annotation.FieldDefine;
import com.bms.cfcmms.util.annotation.TableDefine;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;

/**
 * Created by carl on 2016/4/19.
 */
@Data
@TableDefine(group = "系统设置",
        id = 9906, title = "运行参数设置", primaryKey = "systeminfoId")
public class SystemInfo extends BaseModel {

    public static final int THE_FIRST_RECORD = 1;

    @Id
    @Column(insertable = false, updatable = false)
    @FieldDefine(title = "序号", number = 10, hidden = true)
    private Integer systeminfoId;

    @FieldDefine(title = "系统名称", nameField = true, number = 20)
    @Column(length = 50, nullable = false)
    private String systemName;

    @FieldDefine(title = "版本号", number = 30)
    @Column(length = 50, nullable = false)
    private String systemVersion;

    @FieldDefine(title = "附加信息", number = 40)
    @Column(length = 50)
    private String systemAddition;

    @FieldDefine(title = "版权所有", number = 50)
    @Column(length = 50, nullable = false)
    private String copyrightOwner;

    @FieldDefine(title = "版权信息", number = 60)
    @Column(length = 50, nullable = false)
    private String copyrightInfo;

    @FieldDefine(title = "单点登录", number = 100)
    @Column(nullable = false)
    private Boolean allowExternalLogin; // 是否可以外部单点登录

    @FieldDefine(title = "更改初始密码", remark = "是否需要在第一次登录的时候修改初始密码", number = 120)
    @Column(nullable = false)
    private Boolean needReplaceInitialPassword; // 是否需要修改初始密码，在第一次登录的时候

    @FieldDefine(title = "需要验证码", number = 130)
    @Column(nullable = false)
    private Boolean needIdentifingCode; // 是否需要验证码

    @FieldDefine(title = "总是需要验证码", remark = "是否总是需要验证码，如果是false,则登录时输错一次密码后才显示验证码", number = 140)
    @Column(nullable = false)
    private Boolean alwaysNeedIdentifingCode; // 是否总是需要验证码，如果是false,登录密码错过一次后才显示

    @JsonIgnore
    @FieldDefine(title = "最大登录用户数", number = 150)
    @Column(nullable = false)
    private Integer maxusers;

    @FieldDefine(title = "超时时间分种", number = 160)
    @Column(nullable = false)
    private Integer sessionTimeoutMinute;

    @FieldDefine(title = "数据备份文件名", number = 180)
    @Column(length = 50, nullable = false)
    private String backupfilename;

    @FieldDefine(title = "备注", number = 300)
    @Column(length = 255, nullable = false)
    private String remark;
}
